package com.xinghai.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xinghai.common.annotation.DataScope;
import com.xinghai.system.domain.XhVehicleOrderInfo;
import com.xinghai.system.domain.dto.DeptFeeDetailDTO;
import com.xinghai.system.domain.dto.ProjectFeeDetailDTO;
import com.xinghai.system.domain.dto.TransferDetailDTO;
import com.xinghai.system.domain.dto.XhVehicleOrderInfoDTO;
import com.xinghai.system.domain.vo.XhStaticsReportQueryVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用车订单Mapper接口
 * 
 * @author xinghai
 * @date 2024-07-23
 */
public interface XhVehicleOrderInfoMapper extends BaseMapper<XhVehicleOrderInfo>
{
    /**
     * 查询用车订单
     * 
     * @param id 用车订单主键
     * @return 用车订单
     */
    public XhVehicleOrderInfo getInfo(Long id);

    /**
     * 查询用车订单列表
     * 
     * @param xhVehicleOrderInfo 用车订单
     * @return 用车订单集合
     */
    public List<XhVehicleOrderInfoDTO> list(XhVehicleOrderInfo xhVehicleOrderInfo);

    /**
     * 新增用车订单
     *
     * @param xhVehicleOrderInfo 用车订单
     * @return 结果
     */
    public int insert(XhVehicleOrderInfo xhVehicleOrderInfo);

    /**
     * 批量新增用车订单
     *
     * @param xhVehicleOrderInfo 用车订单
     * @return 结果
     */
    public int insertBatch(List<XhVehicleOrderInfo> xhVehicleOrderInfoList);

    /**
     * 修改用车订单
     * 
     * @param xhVehicleOrderInfo 用车订单
     * @return 结果
     */
    public int update(XhVehicleOrderInfo xhVehicleOrderInfo);

    /**
     * 删除用车订单
     * 
     * @param id 用车订单主键
     * @return 结果
     */
    public int delete(Long id);

    /**
     * 批量删除用车订单
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteBatch(Long[] ids);

    List<XhVehicleOrderInfo> selectBatchByVehicleIds(@Param("vehicleIds") List<Long> vehicleIds);

    /**
     * 根据流程id更新订单状态
     *
     * @param processInstanceId 流程id
     * @param status 状态
     */
    void updateStatusByProcessInstanceId(@Param("processInstanceId") String processInstanceId,@Param("status") String status);

    /**
     * 各项目运输费用
     *
     * @param xhStaticsReportQueryVo 查询条件
     */
    List<ProjectFeeDetailDTO> projectFeeDetailPage(XhStaticsReportQueryVo xhStaticsReportQueryVo);

    /**
     * 各物流公司运输费用
     *
     * @param xhStaticsReportQueryVo 查询条件
     */
    List<DeptFeeDetailDTO> deptFeeDetailPage(XhStaticsReportQueryVo xhStaticsReportQueryVo);

    /**
     * 查询失效订单列表
     *
     * @param xhVehicleOrderInfo 用车订单
     * @return 用车订单集合
     */
    @DataScope(deptAlias = "d")
    List<XhVehicleOrderInfoDTO> expiresList(XhVehicleOrderInfo xhVehicleOrderInfo);

    /**
     * 查询运输明细模板
     *
     * @param xhStaticsReportQueryVo 用车订单
     * @return 用车订单集合
     */
    List<TransferDetailDTO> transferDetailPage(XhStaticsReportQueryVo xhStaticsReportQueryVo);

    /**
     * 根据司机id查询订单数组
     *
     * @param driverId 司机id
     * @return 用车订单集合
     */
    List<XhVehicleOrderInfo> getOrderListByDriverId(Long driverId);
}
